;(function ($) {

    $.ajax({
        url: "/api/agt_species/"+getId(),
        dataType: "json",
        async: false,
        success: function (result) {
            let obj = result;
            let div = $("#content").find("#sul");
            div.append(`<li class="cont_1">
      <div class="cont_left">
        <div class="user_pig">
          <div class="user_name"><b>${obj.speciesName}</b></div>
        </div>
      </div>
      <div class="cont_right">
        <div class="cont_word">
          <img src="${obj.speciesCover}">
          <span class="left_quote"></span>
          <span class="right_quote"></span>
        </div>
      </div>
    </li>
    <li class="cont_2">
      <div class="cont_left">
        <div class="user_pig">
          <div class="user_name">摘要</div>
        </div>
      </div>
      <div class="cont_right">
        <div class="cont_word">
          <span>${obj.speciesAbstract}</span>
          <span class="left_quote"></span>
          <span class="right_quote"></span>
        </div>
      </div>
    </li>
    <li class="cont_3">
      <div class="cont_left">
        <div class="user_pig">
          <div class="user_name">具体介绍</div>
        </div>
      </div>
      <div class="cont_right">
        <div class="cont_word">
          <div>${obj.speciesContent}</div>
          <span class="left_quote"></span>
          <span class="right_quote"></span>
        </div>
      </div>
    </li>`);
        }
    });

    function GetQueryString(name)
    {
        var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
        var r = window.location.search.substr(1).match(reg);
        if(r!=null)return  unescape(r[2]); return null;
    }

    function getContextPath() {
        let pathName = document.location.pathname;
        let index = pathName.substr(1).indexOf("/");
        let result = pathName.substr(0, index + 1);
        console.log(pathName,index,result);
        return result;
    }

    function getId() {
        let pathName = document.location.pathname;
        let index = pathName.substr(1).lastIndexOf("/");
        let id = pathName.substr(index + 2);
        console.log(pathName,index,id);
        return id;
    }
})(window.jQuery);